package com.xinyi.share.utils;

import com.xinyi.share.vo.BaiduConfig;
import com.xinyi.share.vo.WeixinConfig;


/**
 * 
 * @ClassName: SecurityKeys
 * @Description: 密匙
 * @author wangchuan
 * @date 2014年10月23日 上午11:37:18
 *
 */
public final class SecurityKeys {
	private static SecurityKeys instance = null;
	private BaiduConfig baiduConfig;
	private WeixinConfig weixinConfig;
	private SecurityKeys() {
	}

	private static class InstanceClass {
		private static SecurityKeys getInstance() {
			if (null == instance)
				instance = new SecurityKeys();
			return instance;
		}
	}

	public static SecurityKeys getInstance() {
		return InstanceClass.getInstance();
	}
	
	
	public void initBaiduConfig(String ak){
		if(null==baiduConfig)
			baiduConfig = new BaiduConfig();
		baiduConfig.setAk(ak);
	}
	
	public void initWeixin(String appid,String appsecret,String token){
		if(null == weixinConfig)
			weixinConfig = new WeixinConfig();
		weixinConfig.setAppid(appid);
		weixinConfig.setAppsecret(appsecret);
		weixinConfig.setToken(token);
	}
	
	
	
	public BaiduConfig getBaiduConfig(){
		return this.baiduConfig;
	}

	public WeixinConfig getWeixinConfig(){
		return weixinConfig;
	}
}
